package com.whj.apiboss.controller;

import com.whj.apiboss.service.DriverCarBindingRelationShipService;
import com.whj.internalcommon.dto.DriverCarBindingRelationship;
import com.whj.internalcommon.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther: wanghaijun
 * @Date: 2023/1/14 - 01 - 14 - 13:08 
 * @Description: com.whj.apiboss.controller
 */

@RestController
@RequestMapping("/driver-car-binding-relationship")
public class DriverCarBindingRelationShipController {

    @Autowired
    private DriverCarBindingRelationShipService driverCarBindingRelationShipService;

    /**
     * 调用service-driver-user服务 实现司机和车辆的绑定
     *
     * @param driverCarBindingRelationship
     * @return
     */
    @PostMapping("/bind")
    public ResponseResult bind(@RequestBody DriverCarBindingRelationship driverCarBindingRelationship) {
        return driverCarBindingRelationShipService.bind(driverCarBindingRelationship);
    }

    /**
     * 调用service-driver-user服务 实现司机和车辆的绑定
     *
     * @param driverCarBindingRelationship
     * @return
     */
    @PostMapping("/unbind")
    public ResponseResult unbind(@RequestBody DriverCarBindingRelationship driverCarBindingRelationship) {
        return driverCarBindingRelationShipService.unbind(driverCarBindingRelationship);
    }
}
